<!DOCTYPE html>
<html lang="zh">
<#import "/spring.ftl" as sp />
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/plugin/bootstrap-3.2.0-dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="/plugin/markdown/css/bootstrap-markdown-editor.css" rel="stylesheet">
    <link href="/static/css/addNew.css" rel="stylesheet">

    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title><@sp.message "add.news.title"/></title>
</head>
<body>
<div class="container-fluid">
<form method="post" action="/admin/addNews" class="form-horizontal" id="addNewForm">
    <div class="form-group">
        <label for="inputTitle" class="col-sm-2 control-label">标题</label>

        <div class="col-sm-10">
        <@sp.formInput "new.title" "class='form-control' placeholder='新闻标题....'"/>
        <@sp.showErrors "<br/>" />
        </div>
    </div>
    <div class="form-group">
        <label for="inputKeywords" class="col-sm-2 control-label">关键字</label>

        <div class="col-sm-10">
        <@sp.formInput "new.keywords" "class='form-control' placeholder='关键字....'"/>

        </div>
    </div>

    <div class="form-group">
        <label for="inputTags" class="col-sm-2 control-label">标签</label>

        <div class="col-sm-10">
        <@sp.formInput "new.tags" "class='form-control' placeholder='标签....'"/>

        </div>
    </div>
    <div class="form-group">
        <label for="inputTitle" class="col-sm-2 control-label">预览图片</label>

        <div class="col-sm-10">
            <input type="file" accept="image/*" id="pic" style="display:none;"/>
            <img src="${(new.picUrl)!}" class="img-responsive img-thumbnail" style="height:150px" alt="图片" id="uploadPic">
        <@sp.formHiddenInput "new.picUrl" />
        </div>
    </div>
    <div class="form-group">
        <label for="inputDesc" class="col-sm-2 control-label">描述</label>

        <div class="col-sm-10">
        <@sp.formTextarea "new.description" "class='form-control'  placeholder='描述信息....' rows=3"/>
        <@sp.showErrors "<br/>" />
        </div>
    </div>

<@sp.formTextarea "new.content" "hidden=true"/>

    <div class="form-group">
        <label for="inputDesc" class="col-sm-2 control-label">正文</label>

        <div class="col-sm-10">
            <div id="myEditor"/>
        </div>
    </div>
    <div class="form-group">
        <label for="inputDesc" class="col-sm-2 control-label"></label>

        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default">保存</button>
        </div>
    </div>
</form>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/plugin/jquery/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/plugin/bootstrap-3.2.0-dist/js/bootstrap.min.js"></script>
<script src="/plugin/markdown/js/ace.js"></script>
<script src="/plugin/markdown/js/marked.min.js"></script>
<script src="/plugin/markdown/js/bootstrap-markdown-editor.js"></script>
<script src="/static/js/addNews.js"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=23984908" charset="UTF-8"></script>
</body>
</html>